
package edu.cmu.cs.webapp.ioms.ui.providers.finreport;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

import edu.cmu.cs.webapp.ioms.models.PurchaseOrder;
import edu.cmu.cs.webapp.ioms.models.util.FinancialReport;

/**
 * @author Christian
 * 
 */
public class FinReportTableViewerContentProvider implements
		IStructuredContentProvider {

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java
	 * .lang.Object)
	 */
	public Object[] getElements(Object parentElement) {
//		if (parentElement instanceof OrderDAO) {
//			return ((OrderDAO) parentElement).getAllOrder().toArray();
//		}
		
//		if(parentElement instanceof DummieDataGenerator){
//			((DummieDataGenerator)parentElement).getOrders();
//		}

		if (parentElement instanceof FinancialReport) {
			return ((FinancialReport) parentElement).getAll();
		}

		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
	 */
	public void dispose() {

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface
	 * .viewers.Viewer, java.lang.Object, java.lang.Object)
	 */
	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
		// TODO Auto-generated method stub

	}

}
